/* 主样式文件 */
/* 暗色主题（默认） */
:root[data-theme="dark"] {
  /* 霓虹科技风主题变量（暗色） */
  --primary-color: #22D3EE;      /* 青色霓虹 */
  --primary-hover: #06B6D4;
  --secondary-color: #818CF8;    /* 靛蓝辅助色 */
  --success-color: #22C55E;
  --error-color: #EF4444;
  --warning-color: #F59E0B;

  /* 背景分层（暗色面板） */
  --bg-primary: #0B1220;   /* 卡片/面板 */
  --bg-secondary: #070B14; /* 页面背景 */
  --bg-tertiary: #0F1A2B;  /* 次级面板 */

  /* 文本颜色（高对比） */
  --text-primary: #E5E7EB;
  --text-secondary: #9CA3AF;
  --border-color: rgba(148,163,184,0.18);

  /* 阴影与圆角 */
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.30);
  --shadow-md: 0 8px 20px rgba(2,6,23,0.45);
  --shadow-lg: 0 20px 50px rgba(2,6,23,0.65);
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;

  /* 主题特定效果 */
  --grid-opacity: 0.04;
  --glow-opacity: 0.30;
  --code-bg: #0A0F1C;
}

/* 亮色主题 */
:root[data-theme="light"] {
  /* 主题颜色 */
  --primary-color: #0EA5E9;
  --primary-hover: #0284C7;
  --secondary-color: #6366F1;
  --success-color: #10B981;
  --error-color: #EF4444;
  --warning-color: #F59E0B;

  /* 背景分层（亮色） */
  --bg-primary: #FFFFFF;   /* 卡片/面板 */
  --bg-secondary: #F8FAFC; /* 页面背景 */
  --bg-tertiary: #F1F5F9;  /* 次级面板 */

  /* 文本颜色 */
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --border-color: #E2E8F0;

  /* 阴影与圆角 */
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;

  /* 主题特定效果 */
  --grid-opacity: 0.15;
  --glow-opacity: 0.08;
  --code-bg: #F8FAFC;
}

/* 默认暗色主题（兼容未设置data-theme的情况） */
:root {
  /* 霓虹科技风主题变量（暗色） */
  --primary-color: #22D3EE;
  --primary-hover: #06B6D4;
  --secondary-color: #818CF8;
  --success-color: #22C55E;
  --error-color: #EF4444;
  --warning-color: #F59E0B;

  /* 背景分层（暗色面板） */
  --bg-primary: #0B1220;
  --bg-secondary: #070B14;
  --bg-tertiary: #0F1A2B;

  /* 文本颜色（高对比） */
  --text-primary: #E5E7EB;
  --text-secondary: #9CA3AF;
  --border-color: rgba(148,163,184,0.18);

  /* 阴影与圆角 */
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.30);
  --shadow-md: 0 8px 20px rgba(2,6,23,0.45);
  --shadow-lg: 0 20px 50px rgba(2,6,23,0.65);
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;

  /* 主题特定效果 */
  --grid-opacity: 0.04;
  --glow-opacity: 0.30;
  --code-bg: #0A0F1C;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
}

/* 按钮样式 */
.btn {
  padding: 0.625rem 1.25rem;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, rgba(34,211,238,0.9), rgba(129,140,248,0.9));
  color: #051018;
  box-shadow: 0 0 0.5rem rgba(34,211,238,0.4), inset 0 0 0.3rem rgba(255,255,255,0.15);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .btn-primary:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: 0 0 0.8rem rgba(34,211,238,0.55), 0 8px 24px rgba(2,6,23,0.6);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .btn-secondary {
  background-color: rgba(255,255,255,0.03);
  backdrop-filter: blur(6px);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--border-color);
}

[data-theme="light"] .btn-secondary:hover:not(:disabled) {
  background-color: #E2E8F0;
}

.btn-large {
  padding: 0.875rem 2rem;
  font-size: 1rem;
}

.btn-text {
  background: none;
  color: var(--primary-color);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}

.btn-text:hover:not(:disabled) {
  background-color: var(--bg-tertiary);
}

/* 输入框样式 */
input, textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  transition: all 0.25s ease;
  font-family: inherit;
  color: var(--text-primary);
}

[data-theme="dark"] input, 
[data-theme="dark"] textarea {
  background: rgba(255,255,255,0.02);
}

input:focus, textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 34, 211, 238), 0.15);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus {
  border-color: rgba(34,211,238,0.6);
  box-shadow: 0 0 0 3px rgba(34,211,238,0.15);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

/* 卡片样式 */
.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .card {
  background: linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  backdrop-filter: blur(8px);
}

/* 加载动画 */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--bg-tertiary);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 通知提示 */
.toast {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 1rem 1.5rem;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  border-left: 4px solid var(--success-color);
}

.toast.error {
  border-left: 4px solid var(--error-color);
}

/* 代码块样式 */
pre {
  background: var(--code-bg);
  color: var(--text-primary);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] pre {
  background: radial-gradient(120% 120% at 0% 0%, rgba(34,211,238,0.10), rgba(34,211,238,0.02)), #0A0F1C;
  color: #E2E8F0;
  box-shadow: inset 0 0 0.5rem rgba(34,211,238,0.08);
}

[data-theme="light"] pre {
  background: #F8FAFC;
  color: #1E293B;
  border: 1px solid #E2E8F0;
}

code {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* 霓虹细节工具类 */
.neon-border {
  box-shadow: 0 0 .5rem rgba(34,211,238,.35), inset 0 0 .35rem rgba(34,211,238,.12);
}

.glass {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* 响应式 */
@media (max-width: 768px) {
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }
  
  .btn-large {
    padding: 0.75rem 1.5rem;
    font-size: 0.9375rem;
  }
}
